package model.preprocessor;


/**
 * Represent a type of preprocessor.
 * 
 * @author GRONOWSKI Stephane svan001@aol.com
 * 
 *         igsat 2010
 * 
 */
public enum EPreProcessor {
	UNKNOW ("Preprocessor", "UNKNOW"), REVIVAL ("Revival", "Revival"), HYPRE ("Hypre", "Hypre"), SATELLITE_1_0 ("Satellite 1.0",
			"Satellite 1.0");


	private String	description;
	private String	xmlValue;

	private EPreProcessor(String description, String xmlValue) {
		this.description = description;
		this.xmlValue = xmlValue;
	}

	/**
	 * Return the xmlValue, value that is supposed to written in the xml exportation.
	 * 
	 * @return the xmlValue
	 */
	public String getXmlValue() {
		return xmlValue;
	}

	/**
	 * Return the description of the preprocessor.
	 * 
	 * @return the description of the preprocessor.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Return the {@link EPreProcessor} associate to a value find in a XML exportation.
	 * 
	 * @param value
	 *            xml value
	 * @return the associate {@link EPreProcessor}
	 */
	public static EPreProcessor getValueFromXML(String value) {
		for (EPreProcessor pre : values())
			if (pre.getXmlValue().equals(value))
				return pre;
		return null;
	}
}
